<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:security="http://www.springframework.org/security/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">创建上线表单</ui:define>
    <ui:define name="content">
        <h:form enctype="multipart/form-data" id="createform">
            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton value="提交" icon="fa fa-edit"
                                         process="@form" actionListener="#{companyInfoAuditBean.onCompanyInfoSubmit}"
                                         update="@form"
                                         rendered="#{companyInfoAuditBean.$.auditStatus==1 or companyInfoAuditBean.$.auditStatus==null}"/>
                        <p:commandButton value="保存" process="@form" icon="fa fa-save"
                                         actionListener="#{companyInfoAuditBean.onCompanyInfoSave}" update="@form"
                                         rendered="#{companyInfoAuditBean.$.auditStatus==1 or companyInfoAuditBean.$.auditStatus==null}"/>
                        <p:button value="返回" icon="fa fa-reply-all" href="#{currentUserBean.back}"/>
                    </f:facet>
                </p:toolbar>
            </div>
            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g-12">
                    <div class="card">
                        <div class="ui-g">
                            <div class="ui-g-12"><h3><b>公司信息</b></h3></div>
                            <div class="ui-g-2">
                                <p:outputLabel value="甲方公司名称"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="companyName" value="#{companyInfoAuditBean.$.companyName}"
                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="合作模式"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="copMode" value="#{companyInfoAuditBean.$.copMode}"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <p:ajax event="change" listener="#{companyInfoAuditBean.onChangeCopMode}" process="@this"
                                            update="perPrice"/>
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{companyInfoAuditBean.dictionaries[DictionaryCode.COOPERATION_MODE]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="纳税识别号"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="taxIdentificationNumber"
                                             value="#{companyInfoAuditBean.$.taxIdentificationNumber}"
                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="公司背景"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="companyBackground" value="#{companyInfoAuditBean.$.companyBackground}"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{companyInfoAuditBean.dictionaries[DictionaryCode.COMPANY_BACKGROUND]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="公司固话"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="companyPhone" value="#{companyInfoAuditBean.$.companyPhone}"
                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">

                                </p:inputText>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="甲方商务姓名"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="contactName" value="#{companyInfoAuditBean.$.contactName}"
                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="甲方商务电话"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="contactPhone" value="#{companyInfoAuditBean.$.contactPhone}"
                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">

                                </p:inputText>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="甲方商务邮箱"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="contactEmail" value="#{companyInfoAuditBean.$.contactEmail}"
                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">

                                </p:inputText>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="甲方对公邮箱"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="firstPartyEmail" value="#{companyInfoAuditBean.$.firstPartyEmail}"
                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">

                                </p:inputText>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="甲方实际办公地址"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="firstPartyAddress" value="#{companyInfoAuditBean.$.firstPartyAddress}"
                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                </p:inputText>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="是否一般纳税人"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputSwitch id="ifGeneralTaxpayer" onLabel="是" offLabel="否"
                                               value="#{companyInfoAuditBean.$.ifGeneralTaxpayer}"
                                               disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <p:ajax event="change" process="@this"
                                            listener="#{companyInfoAuditBean.onChangeGeneralTaxpayer}" update="grid"/>
                                </p:inputSwitch>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="甲方审核方式"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="verifyMode" value="#{companyInfoAuditBean.$.verifyMode}"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems value="#{companyInfoAuditBean.dictionaries[DictionaryCode.APPROVAL_TYPE]}"
                                                   var="dic"
                                                   itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="我司商务负责人"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="principal" value="#{companyInfoAuditBean.$.principal}" filter="true"
                                                 filterMatchMode="contains"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItems value="#{companyInfoAuditBean.principalList}"
                                                   var="principal"
                                                   itemLabel="#{principal.name}" itemValue="#{principal.account}"/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="我司甲方商务核查人"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="auditor" value="#{companyInfoAuditBean.$.auditor}" filter="true"
                                                 filterMatchMode="contains"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItems value="#{companyInfoAuditBean.auditorList}"
                                                   var="auditor"
                                                   itemLabel="#{auditor.name}" itemValue="#{auditor.account}"/>
                                </p:selectOneMenu>
                            </div>


                            <div class="ui-g-12"><h3><b>结算信息</b></h3></div>


                            <div class="ui-g-2">
                                <p:outputLabel value="我司收款账户"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="receivableAccount" value="#{companyInfoAuditBean.$.receivableAccount}"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <p:ajax event="change" process="@this"
                                            listener="#{companyInfoAuditBean.onChangeReceiveAccount}"
                                            update="receivableCardNumber"/>
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{companyInfoAuditBean.dictionaries[DictionaryCode.SETTLEMENT_RECEIVE_ACCOUNT]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="我司收款卡号"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="receivableCardNumber"
                                                 value="#{companyInfoAuditBean.$.receivableCardNumber}"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <p:ajax event="change" process="@this"
                                            listener="#{companyInfoAuditBean.onChangeReceiveAccountNumber}"
                                            update="receivableAccount"/>
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{companyInfoAuditBean.dictionaries[DictionaryCode.SETTLEMENT_RECEIVE_ACCOUNT]}"
                                            var="dic"
                                            itemLabel="#{dic.value2}" itemValue="#{dic.value2}"/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="结算账期"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText type="number" id="settlementPaymentPeroid"
                                                 value="#{companyInfoAuditBean.$.settlementPaymentPeroid}"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    <span class="input-group-addon">工作日</span>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="结算周期"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="settlementPeroid" value="#{companyInfoAuditBean.$.settlementPeroid}"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <p:ajax event="change" process="@this"
                                            listener="#{companyInfoAuditBean.onChangeSettlementPeroid}"
                                            update="amountAdvancedPanel"/>
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{companyInfoAuditBean.dictionaries[DictionaryCode.SETTLEMENT_CYCLE]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>
                            <p:outputPanel id="perPrice" styleClass="ui-g-12" style="padding: 0px">
                                <p:outputPanel styleClass="ui-g-6" style="padding: 0px"
                                               rendered="#{companyInfoAuditBean.$.copMode==1 or companyInfoAuditBean.$.copMode==3 }">
                                    <div class="ui-g-4">
                                        <p:outputLabel value="结算价格"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-8">
                                        <div class="input-group">
                                            <p:inputText type="number" id="settlementPriceCps"
                                                         value="#{companyInfoAuditBean.$.settlementPriceCps}"
                                                         disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                            <span class="input-group-addon">%</span>
                                        </div>
                                    </div>
                                </p:outputPanel>
                                <p:outputPanel id="yuanPrice" styleClass="ui-g-6" style="padding: 0px"
                                               rendered="#{companyInfoAuditBean.$.copMode==0 or companyInfoAuditBean.$.copMode==2 or companyInfoAuditBean.$.copMode==3 }"
                                               disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                    <div class="ui-g-4">
                                        <p:outputLabel value="结算价格"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-8">
                                        <div class="input-group">
                                            <p:inputNumber id="settlementPriceCpa"
                                                           value="#{companyInfoAuditBean.$.settlementPriceCpa}"
                                                           disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                            <span class="input-group-addon">元</span>
                                        </div>
                                    </div>
                                </p:outputPanel>
                            </p:outputPanel>
                            <p:outputPanel id="amountAdvancedPanel" styleClass="ui-g-6" style="padding: 0px;">
                                <p:outputPanel styleClass="ui-g-12" style="padding: 0px"
                                               rendered="#{companyInfoAuditBean.$.settlementPeroid==4}">
                                    <div class="ui-g-4">
                                        <p:outputLabel value="预付金额"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-8">
                                        <div class="input-group">
                                            <p:inputNumber id="amountAdvanced"
                                                           value="#{companyInfoAuditBean.$.amountAdvanced}"
                                                           disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                            <span class="input-group-addon">元</span>
                                        </div>
                                    </div>
                                </p:outputPanel>
                            </p:outputPanel>


                            <div class="ui-g-12"><h3><b>开票信息</b></h3></div>

                            <p:outputPanel id="invoicePanel" styleClass="ui-g-12" style="padding: 0px;">
                                <p:outputPanel styleClass="ui-g-6" style="padding: 0px">
                                    <div class="ui-g-4">
                                        <p:outputLabel value="是否开发票"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-8">
                                        <p:inputSwitch id="ifInvoice" onLabel="是" offLabel="否"
                                                       value="#{companyInfoAuditBean.$.ifInvoice}"
                                                       disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                            <p:ajax event="change" process="@this" listener="#{companyInfoAuditBean.onChangeIfInvoice}"
                                                    update="invoicePanel"/>
                                        </p:inputSwitch>
                                    </div>
                                </p:outputPanel>
                                <p:outputPanel styleClass="ui-g-6" style="padding: 0px"
                                               rendered="#{companyInfoAuditBean.$.ifInvoice == false}">
                                    <div class="ui-g-4">
                                        <p:outputLabel value="打款人姓名"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-8">
                                        <p:inputText id="payer" value="#{companyInfoAuditBean.$.payer}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">

                                        </p:inputText>
                                    </div>
                                </p:outputPanel>
                                <p:outputPanel styleClass="ui-g-12" style="padding: 0px"
                                               rendered="#{companyInfoAuditBean.$.ifInvoice == true}">
                                    <div class="ui-g-2">
                                        <p:outputLabel value="开票内容"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-4">
                                        <p:selectOneMenu id="invoiceContent" value="#{companyInfoAuditBean.$.invoiceContent}"
                                                         disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}">
                                            <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                          noSelectionOption="true"/>
                                            <f:selectItems
                                                    value="#{companyInfoAuditBean.dictionaries[DictionaryCode.SETTLEMENT_BILLING_CONTENT]}"
                                                    var="dic"
                                                    itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                        </p:selectOneMenu>
                                    </div>
                                    <div class="ui-g-2">
                                        <p:outputLabel value="甲方开户支行"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-4">
                                        <p:inputText id="firstPartyBank" value="#{companyInfoAuditBean.$.firstPartyBank}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </div>
                                    <div class="ui-g-6"/>
                                    <div class="ui-g-2">
                                        <p:outputLabel value="甲方银行账户"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-4">
                                        <p:inputText id="firstPartyAccount"
                                                     value="#{companyInfoAuditBean.$.firstPartyAccount}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </div>
                                    <div class="ui-g-2">
                                        <p:outputLabel value="甲方银行卡号"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-4">
                                        <p:inputText id="firstPartyCardNumber"
                                                     value="#{companyInfoAuditBean.$.firstPartyCardNumber}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </div>
                                    <div class="ui-g-2">
                                        <p:outputLabel value="开票地址"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-4">
                                        <p:inputText id="invoiceAddress" value="#{companyInfoAuditBean.$.invoiceAddress}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </div>
                                    <div class="ui-g-2">
                                        <p:outputLabel value="收件人姓名"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-4">
                                        <p:inputText id="recipientsName" value="#{companyInfoAuditBean.$.recipientsName}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </div>
                                    <div class="ui-g-2">
                                        <p:outputLabel value="收件人手机号"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-4">
                                        <p:inputText type="number" id="recipientsMobile"
                                                     value="#{companyInfoAuditBean.$.recipientsMobile}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </div>
                                    <div class="ui-g-2">
                                        <p:outputLabel value="收件详细地址"/>
                                        <strong style="color: red">*</strong>
                                    </div>
                                    <div class="ui-g-4">
                                        <p:inputText id="deliveryAddress" value="#{companyInfoAuditBean.$.deliveryAddress}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </div>
                                </p:outputPanel>
                            </p:outputPanel>

                            <div class="ui-g-12"><h3><b>资质文件上传</b></h3></div>
                            <div class="ui-g-12">
                                <p:panelGrid id="grid" style="width: 100%;text-align: center">
                                    <f:facet name="header">
                                        <p:row>
                                            <p:column>操作</p:column>
                                            <p:column>附件类型</p:column>
                                            <p:column>上传时间</p:column>
                                            <p:column>上传人</p:column>
                                        </p:row>
                                    </f:facet>
                                    <p:row>
                                        <p:column>
                                            <p:fileUpload
                                                    style="width: 90px;display: inline-block;"
                                                    fileUploadListener="#{companyInfoAuditBean.onUploadBusinessLicense}"
                                                    mode="advanced"
                                                    fileLimit="1"
                                                    auto="true"
                                                    fileLimitMessage="只能上传一个文件"
                                                    invalidFileMessage="不支持上传文件类型"
                                                    invalidSizeMessage="文件过大"
                                                    sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                                                    allowTypes="/(\.|\/)(#{constants:get('UPLOAD_DOCUMENT_FILE_SUFFIX')})$/"
                                                    label="上传" update="grid picture1" process="@this"
                                                    disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('dlg1').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[0].attachmentUrl,'.jpg') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[0].attachmentUrl,'.jpeg') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[0].attachmentUrl,'.png') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[0].attachmentUrl,'.gif')}"/>

                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('pdf0').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[0].attachmentUrl,'.pdf' )}"/>

                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('word0').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[0].attachmentUrl,'.doc' ) ||
                                                                fn:endsWith(companyInfoAuditBean.qualificationInfoList[0].attachmentUrl,'.docx' )}"/>

                                            <p:commandButton process="@this"
                                                             value="下载"
                                                             rendered="false">

                                                <!--<p:fileDownload value="#{companyInfoAuditBean.businessLicenseFile}"/>-->
                                            </p:commandButton>

                                            <p:commandButton update="grid"
                                                             process="@this"
                                                             value="删除"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[0].attachmentUrl!=null}"
                                                             actionListener="#{companyInfoAuditBean.deleteImg(1)}"
                                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                        </p:column>
                                        <p:column>营业执照 <strong style="color: red;">*</strong></p:column>
                                        <p:column>
                                            <h:outputText
                                                    value="#{companyInfoAuditBean.qualificationInfoList[0].uploadTime}">
                                                <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                                            </h:outputText>
                                        </p:column>
                                        <p:column>
                                            <h:outputText value="#{companyInfoAuditBean.qualificationInfoList[0].uploader}"/>
                                        </p:column>
                                    </p:row>
                                    <p:row>
                                        <p:column>
                                            <p:fileUpload
                                                    style="width: 90px;display: inline-block;"
                                                    fileUploadListener="#{companyInfoAuditBean.onUploadIdCard}"
                                                    mode="advanced"
                                                    fileLimit="1"
                                                    auto="true"
                                                    fileLimitMessage="只能上传一个文件"
                                                    invalidFileMessage="不支持上传文件类型"
                                                    invalidSizeMessage="文件过大"
                                                    sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                                                    allowTypes="/(\.|\/)(#{constants:get('UPLOAD_FILE_SUFFIX')})$/"
                                                    label="上传" update="grid picture2" process="@this"
                                                    disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('dlg2').show()"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[1].attachmentUrl!=null}"/>
                                            <p:commandButton process="@this"
                                                             value="下载"
                                                             rendered="false">

                                                <!--<p:fileDownload value="#{companyInfoAuditBean.businessLicenseFile}"/>-->
                                            </p:commandButton>

                                            <p:commandButton update="grid"
                                                             process="@this"
                                                             value="删除"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[1].attachmentUrl!=null}"
                                                             actionListener="#{companyInfoAuditBean.deleteImg(2)}"
                                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                        </p:column>
                                        <p:column>法人身份证复印件</p:column>
                                        <p:column>
                                            <h:outputText
                                                    value="#{companyInfoAuditBean.qualificationInfoList[1].uploadTime}">
                                                <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                                            </h:outputText>
                                        </p:column>
                                        <p:column>
                                            <h:outputText value="#{companyInfoAuditBean.qualificationInfoList[1].uploader}"/>
                                        </p:column>
                                    </p:row>

                                    <p:row>
                                        <p:column>
                                            <p:fileUpload
                                                    style="width: 90px;display: inline-block;"
                                                    fileUploadListener="#{companyInfoAuditBean.onUploadLoanApproval}"
                                                    mode="advanced"
                                                    fileLimit="1"
                                                    auto="true"
                                                    fileLimitMessage="只能上传一个文件"
                                                    invalidFileMessage="不支持上传文件类型"
                                                    invalidSizeMessage="文件过大"
                                                    sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                                                    allowTypes="/(\.|\/)(#{constants:get('UPLOAD_DOCUMENT_FILE_SUFFIX')})$/"
                                                    label="上传" update="createform" process="@this"
                                                    disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('dlg3').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[2].attachmentUrl,'.jpg') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[2].attachmentUrl,'.jpeg') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[2].attachmentUrl,'.png') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[2].attachmentUrl,'.gif')}"/>

                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('pdf2').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[2].attachmentUrl,'.pdf' )}"/>

                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('word2').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[2].attachmentUrl,'.doc' ) ||
                                                                fn:endsWith(companyInfoAuditBean.qualificationInfoList[2].attachmentUrl,'.docx' )}"/>

                                            <p:commandButton process="@this"
                                                             value="下载"
                                                             rendered="false">

                                                <!--<p:fileDownload value="#{companyInfoAuditBean.businessLicenseFile}"/>-->
                                            </p:commandButton>

                                            <p:commandButton update="grid"
                                                             process="@this"
                                                             value="删除"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[2].attachmentUrl!=null}"
                                                             actionListener="#{companyInfoAuditBean.deleteImg(3)}"
                                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>

                                            <p:commandButton value="pdf"
                                                             process="@this"
                                                             onclick="PF('dlg8').show()"
                                                             rendered="#{fn:endsWith(null,'.pdf' )}"/>

                                        </p:column>
                                        <p:column>贷款业务批文\小额贷款金融牌照\承诺函</p:column>
                                        <p:column>
                                            <h:outputText
                                                    value="#{companyInfoAuditBean.qualificationInfoList[2].uploadTime}">
                                                <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                                            </h:outputText>
                                        </p:column>
                                        <p:column>
                                            <h:outputText value="#{companyInfoAuditBean.qualificationInfoList[2].uploader}"/>
                                        </p:column>
                                    </p:row>

                                    <p:row>
                                        <p:column>
                                            <p:fileUpload
                                                    style="width: 90px;display: inline-block;"
                                                    fileUploadListener="#{companyInfoAuditBean.onUploadProductLogo}"
                                                    mode="advanced"
                                                    fileLimit="1"
                                                    auto="true"
                                                    fileLimitMessage="只能上传一个文件"
                                                    invalidFileMessage="不支持上传文件类型"
                                                    invalidSizeMessage="文件过大"
                                                    sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                                                    allowTypes="/(\.|\/)(#{constants:get('UPLOAD_FILE_SUFFIX')})$/"
                                                    label="上传" update="grid picture4" process="@this"
                                                    disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('dlg4').show()"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[3].attachmentUrl!=null}"/>
                                            <p:commandButton process="@this"
                                                             value="下载"
                                                             rendered="false">

                                                <!--<p:fileDownload value="#{companyInfoAuditBean.businessLicenseFile}"/>-->
                                            </p:commandButton>

                                            <p:commandButton update="grid"
                                                             process="@this"
                                                             value="删除"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[3].attachmentUrl!=null}"
                                                             actionListener="#{companyInfoAuditBean.deleteImg(4)}"
                                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                        </p:column>
                                        <p:column>产品LOGO</p:column>
                                        <p:column>
                                            <h:outputText
                                                    value="#{companyInfoAuditBean.qualificationInfoList[3].uploadTime}">
                                                <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                                            </h:outputText>
                                        </p:column>
                                        <p:column>
                                            <h:outputText value="#{companyInfoAuditBean.qualificationInfoList[3].uploader}"/>
                                        </p:column>
                                    </p:row>

                                    <p:row>
                                        <p:column>
                                            <p:fileUpload
                                                    style="width: 90px;display: inline-block;"
                                                    fileUploadListener="#{companyInfoAuditBean.onUploadContract}"
                                                    mode="advanced"
                                                    fileLimit="1"
                                                    auto="true"
                                                    fileLimitMessage="只能上传一个文件"
                                                    invalidFileMessage="不支持上传文件类型"
                                                    invalidSizeMessage="文件过大"
                                                    sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                                                    allowTypes="/(\.|\/)(#{constants:get('UPLOAD_DOCUMENT_FILE_SUFFIX')})$/"
                                                    label="上传" update="createform" process="@this"
                                                    disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>

                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('dlg5').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[4].attachmentUrl,'.jpg') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[4].attachmentUrl,'.jpeg') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[4].attachmentUrl,'.png') ||
                                                                  fn:endsWith(companyInfoAuditBean.qualificationInfoList[4].attachmentUrl,'.gif')}"/>

                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('pdf4').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[4].attachmentUrl,'.pdf' )}"/>

                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('word4').show()"
                                                             rendered="#{fn:endsWith(companyInfoAuditBean.qualificationInfoList[4].attachmentUrl,'.doc' ) ||
                                                                fn:endsWith(companyInfoAuditBean.qualificationInfoList[4].attachmentUrl,'.docx' )}"/>

                                            <p:commandButton process="@this"
                                                             value="下载"
                                                             rendered="false">

                                                <!--<p:fileDownload value="#{companyInfoAuditBean.businessLicenseFile}"/>-->
                                            </p:commandButton>

                                            <p:commandButton update="grid"
                                                             process="@this"
                                                             value="删除"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl!=null}"
                                                             actionListener="#{companyInfoAuditBean.deleteImg(5)}"
                                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                        </p:column>
                                        <p:column>已签署合同</p:column>
                                        <p:column>
                                            <h:outputText
                                                    value="#{companyInfoAuditBean.qualificationInfoList[4].uploadTime}">
                                                <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                                            </h:outputText>
                                        </p:column>
                                        <p:column>
                                            <h:outputText value="#{companyInfoAuditBean.qualificationInfoList[4].uploader}"/>
                                        </p:column>
                                    </p:row>

                                    <p:row rendered="#{companyInfoAuditBean.$.ifGeneralTaxpayer}">
                                        <p:column>
                                            <p:fileUpload
                                                    style="width: 90px;display: inline-block;"
                                                    fileUploadListener="#{companyInfoAuditBean.onUploadTaxpayerQualification}"
                                                    mode="advanced"
                                                    fileLimit="1"
                                                    auto="true"
                                                    fileLimitMessage="只能上传一个文件"
                                                    invalidFileMessage="不支持上传文件类型"
                                                    invalidSizeMessage="文件过大"
                                                    sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                                                    allowTypes="/(\.|\/)(#{constants:get('UPLOAD_FILE_SUFFIX')})$/"
                                                    label="上传" update="grid picture6" process="@this"
                                                    disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                            <p:commandButton value="查看"
                                                             process="@this"
                                                             onclick="PF('dlg6').show()"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[5].attachmentUrl!=null}"/>
                                            <p:commandButton process="@this"
                                                             value="下载"
                                                             rendered="false">

                                                <!--<p:fileDownload value="#{companyInfoAuditBean.businessLicenseFile}"/>-->
                                            </p:commandButton>

                                            <p:commandButton update="grid"
                                                             process="@this"
                                                             value="删除"
                                                             rendered="#{companyInfoAuditBean.qualificationInfoList[5].attachmentUrl!=null}"
                                                             actionListener="#{companyInfoAuditBean.deleteImg(6)}"
                                                             disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                        </p:column>
                                        <p:column>一般纳税人资质 <strong style="color: red;">*</strong></p:column>
                                        <p:column>
                                            <h:outputText
                                                    value="#{companyInfoAuditBean.qualificationInfoList[5].uploadTime}">
                                                <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                                            </h:outputText>
                                        </p:column>
                                        <p:column>
                                            <h:outputText value="#{companyInfoAuditBean.qualificationInfoList[5].uploader}"/>
                                        </p:column>
                                    </p:row>
                                </p:panelGrid>
                            </div>


                            <div class="ui-g-12"><h3><b>产品链接</b></h3></div>
                            <div class="ui-g-12">
                                <p:commandButton value="新增" update="productLinks" process="@this,productLinks"
                                                 actionListener="#{companyInfoAuditBean.addProductLink}"
                                                 disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                            </div>
                            <div class="ui-g-12">
                                <p:dataTable id="productLinks" var="pro"
                                             value="#{companyInfoAuditBean.productLinkInfoList}">
                                    <p:column headerText="产品链接">
                                        <h:outputText value="#{pro.productLink}"/>
                                        <p:inputText id="link" value="#{companyInfoAuditBean.productLink}"
                                                     rendered="#{pro.productLink==null}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </p:column>

                                    <p:column headerText="备注说明">
                                        <h:outputText value="#{pro.remark}"/>
                                        <p:inputText id="remark" value="#{companyInfoAuditBean.remark}"
                                                     rendered="#{pro.remark==null}"
                                                     disabled="#{companyInfoAuditBean.$.auditStatus!=1 and companyInfoAuditBean.$.auditStatus!=null}"/>
                                    </p:column>
                                </p:dataTable>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <p:dialog widgetVar="dlg1" width="50%" height="400px" fitViewport="true" position="center" style="text-align: center">
                <h:graphicImage id="picture1" url="#{companyInfoAuditBean.qualificationInfoList[0].attachmentUrl}"/>
            </p:dialog>
            <p:dialog widgetVar="dlg2" width="50%" height="400px" fitViewport="true" position="center" style="text-align: center">
                <h:graphicImage id="picture2" url="#{companyInfoAuditBean.qualificationInfoList[1].attachmentUrl}"/>
            </p:dialog>
            <p:dialog widgetVar="dlg3" width="50%" height="400px" fitViewport="true" position="center" style="text-align: center">
                <h:graphicImage id="picture3" url="#{companyInfoAuditBean.qualificationInfoList[2].attachmentUrl}"/>
            </p:dialog>
            <p:dialog widgetVar="dlg4" width="50%" height="400px" fitViewport="true" position="center" style="text-align: center">
                <h:graphicImage id="picture4" url="#{companyInfoAuditBean.qualificationInfoList[3].attachmentUrl}"/>
            </p:dialog>
            <p:dialog widgetVar="dlg5" width="50%" height="400px" fitViewport="true" position="center" style="text-align: center">
                <h:graphicImage id="picture5" url="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}"/>
            </p:dialog>
            <p:dialog widgetVar="dlg6" width="50%" height="400px" fitViewport="true" position="center" style="text-align: center">
                <h:graphicImage id="picture6" url="#{companyInfoAuditBean.qualificationInfoList[5].attachmentUrl}"/>
            </p:dialog>
			
			<p:dialog widgetVar="pdf0" width="60%">
                <object id="showPdf0" type="application/pdf" data="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}" height="400px" width="100%" internalinstanceid="17">
                    抱歉，你预览的文件暂时无法访问，请点击 <a href="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}"> 下载 </a>  出来进行观看
                </object>
            </p:dialog>

            <p:dialog widgetVar="word0" width="60%" style="text-align: center">
                <object id="showWord0" type="application/msword" data="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}" height="400px" width="100%" internalinstanceid="17">
                    抱歉，你预览的文件暂时无法访问，请点击 <a href="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}"><strong style="color: red">下载</strong> </a>  出来进行查看
                </object>
            </p:dialog>

            <p:dialog widgetVar="pdf2" width="60%">
                <object id="showPdf2" type="application/pdf" data="#{companyInfoAuditBean.qualificationInfoList[2].attachmentUrl}" height="400px" width="100%" internalinstanceid="17">
                    抱歉，你预览的文件暂时无法访问，请点击 <a href="#{companyInfoAuditBean.qualificationInfoList[2].attachmentUrl}"> 下载 </a>  出来进行观看
                </object>
            </p:dialog>

            <p:dialog widgetVar="word2" width="60%" style="text-align: center">
                <object id="showWord2" type="application/msword" data="#{companyInfoAuditBean.qualificationInfoList[2].attachmentUrl}" height="400px" width="100%" internalinstanceid="17">
                        抱歉，你预览的文件暂时无法访问，请点击 <a href="#{companyInfoAuditBean.qualificationInfoList[2].attachmentUrl}"><strong style="color: red">下载</strong> </a>  出来进行查看
                </object>
            </p:dialog>

            <p:dialog widgetVar="pdf4" width="60%">
                <object id="showPdf4" type="application/pdf" data="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}" height="400px" width="100%" internalinstanceid="17">
                    抱歉，你预览的文件暂时无法访问，请点击 <a href="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}"> 下载 </a>  出来进行观看
                </object>
            </p:dialog>

            <p:dialog widgetVar="word4" width="60%" style="text-align: center">
                <object id="showWord4" type="application/msword" data="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}" height="400px" width="100%" internalinstanceid="17">
                    抱歉，你预览的文件暂时无法访问，请点击 <a href="#{companyInfoAuditBean.qualificationInfoList[4].attachmentUrl}"><strong style="color: red">下载</strong> </a>  出来进行查看
                </object>
            </p:dialog>

        </h:form>
    </ui:define>
</ui:composition>